using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Spinning.Spinning.EntityModifiers
{
    class ScaleModifier : DoubleValueModifier
    {
        public ScaleModifier(int startTime, int endTime, Vector2 from, Vector2 to)
            : base(startTime, endTime, from, to)
        {
        }

        protected override void uptateEntity(Interface.IEntity item, float frames, int count)
        {
            Vector2 displacement = (_to - _from) / frames;
            item.Scale = _from+ displacement * count;
        }

        protected override void onStart(Interface.IEntity item, EntityModifier modifier)
        {
             item.Scale = _from;
        }

        protected override void onFinish(Interface.IEntity item, EntityModifier modifier)
        {
           item.Scale = _to;
        }
    }
}
